import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import bootstrap from './core/bootstrap'
import store from './store'
import mixin from './core/mixins/app'
// 引入全局uView
import uView from 'uview-ui';
Vue.use(uView);

import {
  navTo,
  showToast,
  showSuccess,
  showError,
  getShareUrlParams
} from './core/app'


// 挂载全局函数
Vue.prototype.$toast = showToast
Vue.prototype.$success = showSuccess
Vue.prototype.$error = showError
Vue.prototype.$navTo = navTo
Vue.prototype.$getShareUrlParams = getShareUrlParams

// 全局mixin
Vue.mixin(mixin)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App,
  store,
  created: bootstrap
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif